﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AlbumDesigner.Helpers;

namespace AlbumDesigner.Controllers
{
    public class MailController : Controller
    {
        //
        // GET: /Mail/

        public ActionResult Index()
        {
            return View();
        }


        [HttpPost]
        public ActionResult SendMsgToAllEditors(int AlbumId, string MessageText)
        {
            KeyValuePair<bool, string> result = MailHelper.SendMsgMailToAllSectionEditors(AlbumId, MessageText, Url);
            return Json(result.Value);
        }


        // DEBUG ACTIONS
        public ActionResult TestMailMsgToEditor()
        {
            MailHelper.SendMsgMailToSectionEditor(1, "הודעה חשובה לכולם", Url);
            return Json(true, JsonRequestBehavior.AllowGet);
        }

        public ActionResult TestSendMsgToAllEditors()
        {
            MailHelper.SendMsgMailToAllSectionEditors(1, "הודעה חשובה לכולם", Url);
            return Json(true, JsonRequestBehavior.AllowGet);
        }

    }
}
